package b6.vacancyshare.activity;

import b6.vacancyshare.R;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView.*;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import android.widget.TextView;

public class MenuFavorit extends ListActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
  	  super.onCreate(savedInstanceState);
  	  
  	final Intent route1 = new Intent(this, b6.vacancyshare.controller.PenggunaController.class);
  	  setListAdapter(new ArrayAdapter<String>(this, R.layout.list, VACANCIES));

  	  ListView lv = getListView();
  	  lv.setTextFilterEnabled(true);

  	  lv.setOnItemClickListener(new OnItemClickListener() {
  	    public void onItemClick(AdapterView<?> parent, View view,
  	        int position, long id) {
  	      // When clicked, show a toast with the TextView text
  	      Toast.makeText(getApplicationContext(), ((TextView) view).getText(),
  	          Toast.LENGTH_SHORT).show();
  	      startActivity(route1);
  	    }
  	  });
  	}
      static final String[] VACANCIES = new String[] {
          "Vacancy 1", "Vacancy 2", "Vacancy 3"
        };
}